<!DOCTYPE html>
<html>
<head>
    <title>全景图</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <script src="js/common/jquery.min.js"></script>
    <script src="js/common/eventutil.js"></script>
    <title>three.js css3d - panorama</title>
    <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
    <style>
        body {
            background-color: #000000;
            margin: 0;
            cursor: move;
            overflow: hidden;
        }
        .surface { width: 1026px; height: 1026px; background-size: cover; position: absolute; }
        .surface .bg { position: absolute; width: 1026px; height: 1026px; }
    </style>
</head>
<body>
    <div id="arrow"></div>
</body>
<body>
<div>
    <div id="surface_0" class="surface">
        <img class="bg" src="images/posx.jpg" alt="">
    </div>
    <div id="surface_1" class="surface">
        <img class="bg" src="images/negx.jpg" alt="">
    </div>
    <div id="surface_2" class="surface">
        <img class="bg" src="images/posy.jpg" alt="">
    </div>
    <div id="surface_3" class="surface">
        <img class="bg" src="images/negy.jpg" alt="">
    </div>
    <div id="surface_4" class="surface">
        <img class="bg" src="images/posz.jpg" alt="">
    </div>
    <div id="surface_5" class="surface">
        <img class="bg" src="images/negz.jpg" alt="">
    </div>
</div>
<script src="js/three.min.js"></script>
<script src="js/CSS3DRenderer.min.js"></script>
<script src="js/index.js"></script>
<script>
    try {
        var text = "";
        window.addEventListener("deviceorientation", orientationHandler, false);
        function orientationHandler(event) {
            text = ""
            var arrow = document.getElementById("arrow");
            text += "左右旋转：rotate alpha{" + Math.round(event.alpha) + "deg)<p>";
            text += "前后旋转：rotate beta{" + Math.round(event.beta) + "deg)<p>";
            text += "扭转设备：rotate gamma{" + Math.round(event.gamma) + "deg)<p>";
            arrow.innerHTML = text;
        }
    }
    catch (e) {
        $("#arrow").html(e.message)
    }
</script>
</body>
</html>
